home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2005 October / PCWOCT05.iso / Software / FromTheMag / XAMPP 1.4.14 / xampp-win32-1.4.14-installer.exe / xampp / php / pear / docs / SQLite / .tmpsqlite.php < prev    next >
PHP Script  |  2004-03-24  |  795b  |  34 lines

  1. <?php
  2. if (!extension_loaded("sqlite")) {
  3.     dl("sqlite.so");
  4. }
  5.  
  6. debug_zval_dump(sqlite_libversion());
  7. debug_zval_dump(sqlite_libencoding());
  8.  
  9. $s = sqlite_open("weztest.sqlite", 0666, $err);
  10.  
  11. debug_zval_dump($err);
  12. debug_zval_dump($s);
  13.  
  14. $r = sqlite_query("create table foo (a INTEGER PRIMARY KEY, b INTEGER )", $s);
  15. debug_zval_dump(sqlite_last_error($s));
  16. debug_zval_dump(sqlite_error_string(sqlite_last_error($s)));
  17.  
  18. $r = sqlite_query("select *, php('md5', sql) as o from sqlite_master", $s);
  19. debug_zval_dump($r);
  20. debug_zval_dump(sqlite_num_rows($r));
  21. debug_zval_dump(sqlite_num_fields($r));
  22.  
  23. for ($j = 0; $j < sqlite_num_fields($r); $j++) {
  24.     echo "Field $j is " . sqlite_field_name($r, $j) . "\n";
  25. }
  26.  
  27. while ($row = sqlite_fetch_array($r, SQLITE_ASSOC)) {
  28.     print_r($row);
  29. }
  30.  
  31. sqlite_close($s);
  32.  
  33. ?>
  34.